<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/dute_favicon_32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/dute_favicon_16x16.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">
  <link rel="manifest" href="/images/manifest.json">
  <meta name="msapplication-config" content="/images/browserconfig.xml">
  <meta http-equiv="Cache-Control" content="no-transform">
  <meta http-equiv="Cache-Control" content="no-siteapp">
  <meta name="google-site-verification" content="mpI5dkydstZXl6UcDCppqktXK0bbvqdZ6LkZ3KNk4Iw">
  <meta name="baidu-site-verification" content="code-a1LksZX2Ds">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"whitestore.top","root":"/","scheme":"Gemini","version":"7.8.0","exturl":true,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":true,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="学习如何使用jmeter压力测试">
<meta property="og:type" content="article">
<meta property="og:title" content="Jmeter压力测试学习">
<meta property="og:url" content="https://whitestore.top/2023/09/09/note20/index.html">
<meta property="og:site_name" content="爱看书的阿东">
<meta property="og:description" content="学习如何使用jmeter压力测试">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-09-09T00:55:00.446Z">
<meta property="article:modified_time" content="2023-07-16T06:28:09.250Z">
<meta property="article:author" content="阿东">
<meta property="article:tag" content="jmeter 压力测试">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://whitestore.top/2023/09/09/note20/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Jmeter压力测试学习 | 爱看书的阿东</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="爱看书的阿东" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">爱看书的阿东</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">赐他一块白色石头，石头上写着新名</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-sitemap">

    <a href="/sitemap.xml" rel="section"><i class="fa fa-fw fa-sitemap"></i>站点地图</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    

  <span class="exturl github-corner" data-url="aHR0cHM6Ly9naXRodWIuY29tL2xhenlUaW1lcw==" title="Follow me on GitHub" aria-label="Follow me on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></span>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://whitestore.top/2023/09/09/note20/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="阿东">
      <meta itemprop="description" content="随遇而安">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="爱看书的阿东">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Jmeter压力测试学习
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2023-09-09 08:55:00" itemprop="dateCreated datePublished" datetime="2023-09-09T08:55:00+08:00">2023-09-09</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2023-07-16 14:28:09" itemprop="dateModified" datetime="2023-07-16T14:28:09+08:00">2023-07-16</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Java/" itemprop="url" rel="index"><span itemprop="name">Java</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2023/09/09/note20/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2023/09/09/note20/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>13k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>11 分钟</span>
            </span>
            <div class="post-description">学习如何使用jmeter压力测试</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="前言："><a href="#前言：" class="headerlink" title="前言："></a>前言：</h2><p>Jmeter 作为实操性的软件，更注重练习，理论作为参考掌握即可，不需要去具体的纠结</p>
<h1 id="1-目前用的常用测试工具对比"><a href="#1-目前用的常用测试工具对比" class="headerlink" title="1. 目前用的常用测试工具对比"></a>1. 目前用的常用测试工具对比</h1><h2 id="1、loadrunner"><a href="#1、loadrunner" class="headerlink" title="1、loadrunner"></a>1、loadrunner</h2><p>​    性能稳定，压测结果及细粒度大，可以自定义脚本进行压测，但是太过于重大，功能比较繁多</p>
<p>​    1、loadrunner</p>
<h2 id="2、apache-ab-单接口压测最方便"><a href="#2、apache-ab-单接口压测最方便" class="headerlink" title="2、apache ab(单接口压测最方便)"></a>2、apache ab(单接口压测最方便)</h2><p>​    模拟多线程并发请求,ab命令对发出负载的计算机要求很低，既不会占用很多CPU，也不会占用太多的内存，但却会给目标服务器造成巨大的负载, 简单DDOS攻击等</p>
<h2 id="3、webbench"><a href="#3、webbench" class="headerlink" title="3、webbench"></a>3、webbench</h2><p>​    webbench首先fork出多个子进程，每个子进程都循环做web访问测试。子进程把访问的结果通过pipe告诉父进程，父进程做最终的统计结果。</p>
<a id="more"></a>

<h1 id="2-Jmeter基本介绍和使用场景"><a href="#2-Jmeter基本介绍和使用场景" class="headerlink" title="2. Jmeter基本介绍和使用场景"></a>2. Jmeter基本介绍和使用场景</h1><h2 id="1、压测不同的协议和应用"><a href="#1、压测不同的协议和应用" class="headerlink" title="1、压测不同的协议和应用"></a>1、压测不同的协议和应用</h2><p>​    1) Web - HTTP, HTTPS (Java, NodeJS, PHP, <span class="exturl" data-url="aHR0cDovL0FTUC5ORVQ=" title="http://ASP.NET">ASP.NET<i class="fa fa-external-link"></i></span>, …)     2) SOAP / REST Webservices     3) FTP     4) Database via JDBC     5) LDAP 轻量目录访问协议     6) Message-oriented middleware (MOM) via JMS     7) Mail - SMTP(S), POP3(S) and IMAP(S)     8) TCP等等</p>
<h2 id="2、使用场景及优点"><a href="#2、使用场景及优点" class="headerlink" title="2、使用场景及优点"></a>2、使用场景及优点</h2><p>1）功能测试     </p>
<p>2）压力测试     </p>
<p>3）分布式压力测试     </p>
<p>4）纯java开发     </p>
<p>5）上手容易，高性能     </p>
<p>6）提供测试数据分析     </p>
<p>7）各种报表数据图形展示</p>
<h1 id="3-本地快速安装Jmeter4-x"><a href="#3-本地快速安装Jmeter4-x" class="headerlink" title="3. 本地快速安装Jmeter4.x"></a>3. 本地快速安装Jmeter4.x</h1><h2 id="1、需要安装JDK8。或者JDK9-JDK10-建议不要使用jre10"><a href="#1、需要安装JDK8。或者JDK9-JDK10-建议不要使用jre10" class="headerlink" title="1、需要安装JDK8。或者JDK9,JDK10 (建议不要使用jre10)"></a>1、需要安装JDK8。或者JDK9,JDK10 (建议不要使用jre10)</h2><h2 id="2、快速下载"><a href="#2、快速下载" class="headerlink" title="2、快速下载"></a>2、快速下载</h2><p>​    windows： <span class="exturl" data-url="aHR0cDovL21pcnJvcnMudHVuYS50c2luZ2h1YS5lZHUuY24vYXBhY2hlLy9qbWV0ZXIvYmluYXJpZXMvYXBhY2hlLWptZXRlci00LjAuemlw" title="http://mirrors.tuna.tsinghua.edu.cn/apache//jmeter/binaries/apache-jmeter-4.0.zip">http://mirrors.tuna.tsinghua.edu.cn/apache//jmeter/binaries/apache-jmeter-4.0.zip<i class="fa fa-external-link"></i></span>     </p>
<p>mac或者linux：<span class="exturl" data-url="aHR0cDovL21pcnJvcnMudHVuYS50c2luZ2h1YS5lZHUuY24vYXBhY2hlLy9qbWV0ZXIvYmluYXJpZXMvYXBhY2hlLWptZXRlci00LjAudGd6" title="http://mirrors.tuna.tsinghua.edu.cn/apache//jmeter/binaries/apache-jmeter-4.0.tgz">http://mirrors.tuna.tsinghua.edu.cn/apache//jmeter/binaries/apache-jmeter-4.0.tgz<i class="fa fa-external-link"></i></span></p>
<h2 id="3、文档地址：http-jmeter-apache-org-usermanual-get-started-html"><a href="#3、文档地址：http-jmeter-apache-org-usermanual-get-started-html" class="headerlink" title="3、文档地址：http://jmeter.apache.org/usermanual/get-started.html"></a>3、文档地址：<span class="exturl" data-url="aHR0cDovL2ptZXRlci5hcGFjaGUub3JnL3VzZXJtYW51YWwvZ2V0LXN0YXJ0ZWQuaHRtbA==" title="http://jmeter.apache.org/usermanual/get-started.html">http://jmeter.apache.org/usermanual/get-started.html<i class="fa fa-external-link"></i></span></h2><h2 id="4、建议安装JDK环境，虽然JRE也可以，但是压测https需要JDK里面的-keytool工具"><a href="#4、建议安装JDK环境，虽然JRE也可以，但是压测https需要JDK里面的-keytool工具" class="headerlink" title="4、建议安装JDK环境，虽然JRE也可以，但是压测https需要JDK里面的 keytool工具"></a>4、建议安装JDK环境，虽然JRE也可以，但是压测https需要JDK里面的 keytool工具</h2><h1 id="4-jemeter-目录结构"><a href="#4-jemeter-目录结构" class="headerlink" title="4. jemeter 目录结构"></a>4. jemeter 目录结构</h1><h2 id="bin-核心可执行文件，包含配置"><a href="#bin-核心可执行文件，包含配置" class="headerlink" title="bin:核心可执行文件，包含配置"></a>bin:核心可执行文件，包含配置</h2><p>jmeter.bat: windows启动文件：     </p>
<p>jmeter: mac或者linux启动文件：     </p>
<p>jmeter-server：mac或者Liunx分布式压测使用的启动文件  </p>
<p>jmeter-server.bat：mac或者Liunx分布式压测使用的启动文件     </p>
<p>jmeter.properties: 核心配置文件 </p>
<h2 id="extras：插件拓展的包"><a href="#extras：插件拓展的包" class="headerlink" title="extras：插件拓展的包"></a>extras：插件拓展的包</h2><p>lib:核心的依赖包     </p>
<p>ext:核心包     </p>
<p>junit:单元测试包</p>
<h1 id="5-改变jmeter的GUI界面语言版本"><a href="#5-改变jmeter的GUI界面语言版本" class="headerlink" title="5. 改变jmeter的GUI界面语言版本"></a>5. 改变jmeter的GUI界面语言版本</h1><h2 id="1、控制台修改"><a href="#1、控制台修改" class="headerlink" title="1、控制台修改"></a>1、控制台修改</h2><p>​    <code>menu -&gt; options -&gt; choose language</code></p>
<h2 id="2、配置文件修改"><a href="#2、配置文件修改" class="headerlink" title="2、配置文件修改"></a>2、配置文件修改</h2><p>​    <code>bin目录 -&gt; jmeter.properties     默认 #language=en     改为 language=zh_CN</code></p>
<h1 id="6-jemeter-菜单介绍"><a href="#6-jemeter-菜单介绍" class="headerlink" title="6. jemeter 菜单介绍"></a>6. jemeter 菜单介绍</h1><h2 id="1、添加-gt-threads-gt-线程组（控制总体并发）"><a href="#1、添加-gt-threads-gt-线程组（控制总体并发）" class="headerlink" title="1、添加-&gt;threads-&gt;线程组（控制总体并发）"></a>1、添加-&gt;threads-&gt;线程组（控制总体并发）</h2><ul>
<li>线程数：虚拟用户数。一个虚拟用户占用一个进程或线程</li>
<li>准备时长（Ramp-Up Period(in seconds)）：全部线程启动的时长，比如100个线程，20秒，则表示20秒内100个线程都要启动完成，每秒启动5个线程</li>
<li>循环次数：每个线程发送的次数，假如值为5，100个线程，则会发送500次请求，可以勾选永远循环</li>
</ul>
<h2 id="2、线程组-gt-添加-gt-Sampler-采样器-gt-Http-（一个线程组下面可以增加几个Sampler）"><a href="#2、线程组-gt-添加-gt-Sampler-采样器-gt-Http-（一个线程组下面可以增加几个Sampler）" class="headerlink" title="2、线程组-&gt;添加-&gt; Sampler(采样器) -&gt; Http （一个线程组下面可以增加几个Sampler）"></a>2、线程组-&gt;添加-&gt; Sampler(采样器) -&gt; Http （一个线程组下面可以增加几个Sampler）</h2><ul>
<li>名称：采样器名称</li>
<li>注释：对这个采样器的描述</li>
<li>web服务器：<ul>
<li>默认协议是http</li>
<li>默认端口是80</li>
<li>服务器名称或IP ：请求的目标服务器名称或IP地址</li>
</ul>
</li>
<li>路径：服务器URL</li>
<li><strong>Use multipart/from-data for HTTP POST</strong> ：当发送POST请求时，使用Use multipart/from-data方法发送，默认不选中。</li>
</ul>
<h2 id="3、查看测试结果"><a href="#3、查看测试结果" class="headerlink" title="3、查看测试结果"></a>3、查看测试结果</h2><h3 id="线程组-gt-添加-gt-监听器-gt-察看结果树"><a href="#线程组-gt-添加-gt-监听器-gt-察看结果树" class="headerlink" title="线程组-&gt;添加-&gt;监听器-&gt;察看结果树"></a>线程组-&gt;添加-&gt;监听器-&gt;察看结果树</h3><h1 id="7-断言的基本使用"><a href="#7-断言的基本使用" class="headerlink" title="7. 断言的基本使用"></a>7. 断言的基本使用</h1><h2 id="1-增加断言-线程组-gt-添加-gt-断言-gt-响应断言"><a href="#1-增加断言-线程组-gt-添加-gt-断言-gt-响应断言" class="headerlink" title="1. 增加断言: 线程组 -&gt; 添加 -&gt; 断言 -&gt; 响应断言"></a>1. 增加断言: 线程组 -&gt; 添加 -&gt; 断言 -&gt; 响应断言</h2><p>apply to(应用范围):     Main sample only: 仅当前父取样器 进行断言，一般一个请求，如果发一个请求会触发多个，则就有sub sample（比较少用）</p>
<h2 id="2-要测试的响应字段："><a href="#2-要测试的响应字段：" class="headerlink" title="2.要测试的响应字段："></a>2.要测试的响应字段：</h2><ul>
<li>响应文本：即响应的数据，比如json等文本</li>
<li>响应代码：http的响应状态码，比如200，302，404这些</li>
<li>响应信息：http响应代码对应的响应信息，例如：OK, Found</li>
<li>Response Header: 响应头</li>
</ul>
<h2 id="3-模式匹配规则："><a href="#3-模式匹配规则：" class="headerlink" title="3.模式匹配规则："></a>3.模式匹配规则：</h2><ul>
<li>包括：包含在里面就成功</li>
<li>匹配：响应内容完全匹配，不区分大小写</li>
<li>equals：完全匹配，区分大小写</li>
</ul>
<h2 id="4-断言结果监听器-线程组-gt-添加-gt-监听器-gt-断言结果"><a href="#4-断言结果监听器-线程组-gt-添加-gt-监听器-gt-断言结果" class="headerlink" title="4.断言结果监听器: 线程组-&gt; 添加 -&gt; 监听器 -&gt; 断言结果"></a>4.断言结果监听器: 线程组-&gt; 添加 -&gt; 监听器 -&gt; 断言结果</h2><p>里面的内容是sampler采样器的名称     断言失败，查看结果树任务结果颜色标红(通过结果数里面双击不通过的记录，可以看到错误信息)</p>
<h2 id="5-每个sample下面可以加单独的结果树，然后同时加多个断言，最外层可以加个结果树进行汇总"><a href="#5-每个sample下面可以加单独的结果树，然后同时加多个断言，最外层可以加个结果树进行汇总" class="headerlink" title="5.每个sample下面可以加单独的结果树，然后同时加多个断言，最外层可以加个结果树进行汇总"></a>5.每个sample下面可以加单独的结果树，然后同时加多个断言，最外层可以加个结果树进行汇总</h2><h1 id="8-Jmeter压测结果聚合报告分析"><a href="#8-Jmeter压测结果聚合报告分析" class="headerlink" title="8. Jmeter压测结果聚合报告分析"></a>8. Jmeter压测结果聚合报告分析</h1><h2 id="1-新增聚合报告：线程组-gt-添加-gt-监听器-gt-聚合报告（Aggregate-Report）"><a href="#1-新增聚合报告：线程组-gt-添加-gt-监听器-gt-聚合报告（Aggregate-Report）" class="headerlink" title="1.新增聚合报告：线程组-&gt;添加-&gt;监听器-&gt;聚合报告（Aggregate Report）"></a>1.新增聚合报告：线程组-&gt;添加-&gt;监听器-&gt;聚合报告（Aggregate Report）</h2><ul>
<li>lable: sampler的名称</li>
<li>Samples: 一共发出去多少请求,例如10个用户，循环10次，则是 100</li>
<li>Average: 平均响应时间</li>
<li>Median: 中位数，也就是 50％ 用户的响应时间</li>
<li>90% Line : 90％ 用户的响应不会超过该时间 （90% of the samples took no more than this time. The remaining samples at least as long as this）</li>
<li>95% Line : 95％ 用户的响应不会超过该时间</li>
<li>99% Line : 99％ 用户的响应不会超过该时间</li>
<li>min : 最小响应时间</li>
<li>max : 最大响应时间</li>
<li>Error%：错误的请求的数量/请求的总数</li>
<li><strong>Throughput： 吞吐量——默认情况下表示每秒完成的请求数（Request per Second) 可类比为qps     KB/Sec: 每秒接收数据量</strong></li>
</ul>
<h2 id="2-为什么使用：很多变量在全局中都有使用，或者测试数据更改，可以在一处定义，四处使用-比如服务器地址"><a href="#2-为什么使用：很多变量在全局中都有使用，或者测试数据更改，可以在一处定义，四处使用-比如服务器地址" class="headerlink" title="2.为什么使用：很多变量在全局中都有使用，或者测试数据更改，可以在一处定义，四处使用(比如服务器地址)"></a>2.为什么使用：很多变量在全局中都有使用，或者测试数据更改，可以在一处定义，四处使用(比如服务器地址)</h2><h3 id="1、线程组-gt-add-gt-Config-Element-配置原件-gt-User-Definde-Variable（用户定义的变量）"><a href="#1、线程组-gt-add-gt-Config-Element-配置原件-gt-User-Definde-Variable（用户定义的变量）" class="headerlink" title="1、线程组-&gt;add -&gt; Config Element(配置原件)-&gt; User Definde Variable（用户定义的变量）"></a>1、线程组-&gt;add -&gt; Config Element(配置原件)-&gt; User Definde Variable（用户定义的变量）</h3><h3 id="2、引用方式-XXX-，在接口中变量中使用"><a href="#2、引用方式-XXX-，在接口中变量中使用" class="headerlink" title="2、引用方式${XXX}，在接口中变量中使用"></a>2、引用方式${XXX}，在接口中变量中使用</h3><h3 id="3、原始查看结果树和非原生查看（基础按钮）"><a href="#3、原始查看结果树和非原生查看（基础按钮）" class="headerlink" title="3、原始查看结果树和非原生查看（基础按钮）"></a>3、原始查看结果树和非原生查看（基础按钮）</h3><h1 id="9-CSV可变参数压测（重要）"><a href="#9-CSV可变参数压测（重要）" class="headerlink" title="9. CSV可变参数压测（重要）"></a>9. CSV可变参数压测（重要）</h1><p><strong>实战操作jmeter读取CSV和Txt文本文件里面的参数进行压测</strong></p>
<h2 id="1、线程组-gt-add-gt-Config-Element-配置原件-gt-CSV-data-set-config-CSV数据文件设置"><a href="#1、线程组-gt-add-gt-Config-Element-配置原件-gt-CSV-data-set-config-CSV数据文件设置" class="headerlink" title="1、线程组-&gt;add -&gt; Config Element(配置原件)-&gt; CSV data set config (CSV数据文件设置)"></a>1、线程组-&gt;add -&gt; Config Element(配置原件)-&gt; CSV data set config (CSV数据文件设置)</h2><h2 id="2、在读取的配置文件里面，同时使用多个自定义参数"><a href="#2、在读取的配置文件里面，同时使用多个自定义参数" class="headerlink" title="2、在读取的配置文件里面，同时使用多个自定义参数"></a>2、在读取的配置文件里面，同时使用多个自定义参数</h2><p>如果是多个参数需要同时引用，则在CSV数据文件里面设置加多个字段 Variabled names(comma-delitited): csv_name,csv_pwd</p>
<h1 id="10、JDBC-request压测Mysql"><a href="#10、JDBC-request压测Mysql" class="headerlink" title="10、JDBC request压测Mysql"></a>10、JDBC request压测Mysql</h1><h2 id="1、Thread-Group-gt-add-gt-sampler-gt-jdbc-request"><a href="#1、Thread-Group-gt-add-gt-sampler-gt-jdbc-request" class="headerlink" title="1、Thread Group -&gt; add -&gt; sampler -&gt; jdbc request"></a>1、Thread Group -&gt; add -&gt; sampler -&gt; jdbc request</h2><h2 id="2、jar包添加-mysql-connector-java-5-1-30-jar"><a href="#2、jar包添加-mysql-connector-java-5-1-30-jar" class="headerlink" title="2、jar包添加 mysql-connector-java-5.1.30.jar"></a>2、jar包添加 mysql-connector-java-5.1.30.jar</h2><h2 id="3、JDBC-connection-Configuration-配置"><a href="#3、JDBC-connection-Configuration-配置" class="headerlink" title="3、JDBC connection Configuration 配置"></a>3、JDBC connection Configuration 配置</h2><p><strong>JDBC request-&gt;add -&gt; config element -&gt; JDBC connection configuration</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">核心配置</span><br><span class="line">	Max Number of connections : 最大连接数</span><br><span class="line">	MAX wait :最大等待时间</span><br><span class="line">	Auto Commit: 是否自动提交事务</span><br><span class="line"></span><br><span class="line">	DataBase URL : 数据库连接地址 jdbc:mysql:&#x2F;&#x2F;127.0.0.1:3306&#x2F;blog</span><br><span class="line">	JDBC Driver Class : 数据库驱动，选择对应的mysql</span><br><span class="line">	username:数据库用户名</span><br><span class="line">	password:数据库密码</span><br></pre></td></tr></table></figure>

<h1 id="11-request压测Mysql-select语句"><a href="#11-request压测Mysql-select语句" class="headerlink" title="11. request压测Mysql, select语句"></a>11. request压测Mysql, select语句</h1><ul>
<li>个人测试1</li>
</ul>
<p>\</p>
<ul>
<li>个人测试2<ul>
<li>注意：需要添加一个全局的debug采集器采集查询结果</li>
<li>可以看到如图所示结果</li>
</ul>
</li>
</ul>
<h2 id="1-Debug-Sampler使用（结果树中查看）"><a href="#1-Debug-Sampler使用（结果树中查看）" class="headerlink" title="1. Debug Sampler使用（结果树中查看）"></a>1. Debug Sampler使用（结果树中查看）</h2><p>​    Thread Group -&gt; add -&gt; sampler -&gt; debug sampler</p>
<h2 id="2-参数讲解：-sql结尾不要加”-”"><a href="#2-参数讲解：-sql结尾不要加”-”" class="headerlink" title="2. 参数讲解：(sql结尾不要加”;”)"></a>2. 参数讲解：(sql结尾不要加”;”)</h2><ul>
<li>variable name of pool declared in JDBC connection configuration（和配置文件同名）</li>
<li>Query Type 查询类型</li>
<li>parameter values 参数值</li>
<li>parameter types 参数类型</li>
<li>variable names sql执行结果变量名</li>
<li>result variable names 所有结果当做一个对象存储</li>
<li>query timeouts 查询超时时间</li>
<li>handle results 处理结果集</li>
</ul>
<h1 id="12-分布式压测（学习重点）"><a href="#12-分布式压测（学习重点）" class="headerlink" title="12. 分布式压测（学习重点）"></a>12. 分布式压测（学习重点）</h1><p>官网教程： <span class="exturl" data-url="aHR0cDovL2ptZXRlci5hcGFjaGUub3JnL3VzZXJtYW51YWwvam1ldGVyX2Rpc3RyaWJ1dGVkX3Rlc3Rpbmdfc3RlcF9ieV9zdGVwLmh0bWw=" title="http://jmeter.apache.org/usermanual/jmeter_distributed_testing_step_by_step.html">http://jmeter.apache.org/usermanual/jmeter_distributed_testing_step_by_step.html<i class="fa fa-external-link"></i></span></p>
<ul>
<li>普通压测：单台机可以对目标机器产生的压力比较小，受限因素包括CPU，网络，IO等</li>
<li>分布式压测：利用多台机器向目标机器产生压力，模拟几万用户并发访问</li>
</ul>
<h1 id="13-Jmeter分布式压测原理-了解"><a href="#13-Jmeter分布式压测原理-了解" class="headerlink" title="13. Jmeter分布式压测原理(了解)"></a>13. Jmeter分布式压测原理(了解)</h1><p>1、总控机器的节点master，其他产生压力的机器叫“肉鸡” server</p>
<p>2、master会把压测脚本发送到 server上面</p>
<p>3、执行的时候，server上只需要把jmeter-server打开就可以了，不用启动jmeter</p>
<p>4、结束后，server会把压测数据回传给master,然后master汇总输出报告</p>
<p>5、配置详情</p>
<h1 id="14-阿里云安装jmeter-守护进程：nohup-java-jar-xxxxx-amp"><a href="#14-阿里云安装jmeter-守护进程：nohup-java-jar-xxxxx-amp" class="headerlink" title="14. 阿里云安装jmeter (守护进程：nohup java -jar xxxxx &amp;)"></a>14. 阿里云安装jmeter (守护进程：nohup java -jar xxxxx &amp;)</h1><h2 id="1-下载方式：wget-http-apache-osuosl-org-jmeter-binaries-apache-jmeter-4-0-tgz"><a href="#1-下载方式：wget-http-apache-osuosl-org-jmeter-binaries-apache-jmeter-4-0-tgz" class="headerlink" title="1. 下载方式：wget http://apache.osuosl.org//jmeter/binaries/apache-jmeter-4.0.tgz"></a>1. 下载方式：wget <span class="exturl" data-url="aHR0cDovL2FwYWNoZS5vc3Vvc2wub3JnLy9qbWV0ZXIvYmluYXJpZXMvYXBhY2hlLWptZXRlci00LjAudGd6" title="http://apache.osuosl.org//jmeter/binaries/apache-jmeter-4.0.tgz">http://apache.osuosl.org//jmeter/binaries/apache-jmeter-4.0.tgz<i class="fa fa-external-link"></i></span></h2><h2 id="2-直接到官网下载对应tag-gz包，并在服务器解压"><a href="#2-直接到官网下载对应tag-gz包，并在服务器解压" class="headerlink" title="2. 直接到官网下载对应tag.gz包，并在服务器解压"></a>2. 直接到官网下载对应tag.gz包，并在服务器解压</h2><h1 id="15-Jmeter非GUI界面-参数讲解-必须掌握"><a href="#15-Jmeter非GUI界面-参数讲解-必须掌握" class="headerlink" title="15. Jmeter非GUI界面 参数讲解(必须掌握)"></a>15. Jmeter非GUI界面 参数讲解(必须掌握)</h1><p>官方配置文件地址： <span class="exturl" data-url="aHR0cDovL2ptZXRlci5hcGFjaGUub3JnL3VzZXJtYW51YWwvZ2V0LXN0YXJ0ZWQuaHRtbA==" title="http://jmeter.apache.org/usermanual/get-started.html">http://jmeter.apache.org/usermanual/get-started.html<i class="fa fa-external-link"></i></span></p>
<ul>
<li><strong>-h</strong> 帮助</li>
<li><strong>-n</strong> 非GUI模式</li>
<li><strong>-t</strong> 指定要运行的 JMeter 测试脚本文件</li>
<li><strong>-l</strong> 记录结果的文件 每次运行之前，(要确保之前没有运行过,即xxx.jtl不存在，不然报错)</li>
<li><strong>-r</strong> Jmter.properties文件中指定的所有远程服务器</li>
<li><strong>-e</strong> 在脚本运行结束后生成html报告</li>
<li><strong>-o</strong> 用于存放html报告的目录（目录要为空，不然报错）</li>
</ul>
<p>jmeter -n -t linux_users_api.jmx -l result.jtl -e -o /usr/local/softwate/jmeter/temp/ResultReport</p>
<p>jmeter -n -t /Users/jack/Desktop/linux_users_api.jmx -l result.jtl -e -o /Users/jack/Desktop/person/jmeter/temp</p>
<p>个人： /usr/local/software/jmeter/project/temp 。。。。</p>
<h2 id="1-阿里云非GUI-jmeter-压测"><a href="#1-阿里云非GUI-jmeter-压测" class="headerlink" title="1.阿里云非GUI jmeter 压测"></a>1.阿里云非GUI jmeter 压测</h2><p>jmx目录：/usr/local/software/jmeter/temp</p>
<p>示例</p>
<p>jmeter -n -t /usr/local/software/jmeter/temp/linux_users_api.jmx -l /usr/local/software/jmeter/temp/jtl/result.jtl</p>
<p>利用软件从阿里云Centos服务器下载压测报告，讲解Jtl文件，并怎么查看文件 可以通过打开jmeter，新建线程组-&gt;summary report-&gt;浏览文件 进行查看</p>
<h2 id="2-讲解Jmeter压测减少资源使用的一些建议，即压测结果更准确"><a href="#2-讲解Jmeter压测减少资源使用的一些建议，即压测结果更准确" class="headerlink" title="2.讲解Jmeter压测减少资源使用的一些建议，即压测结果更准确"></a>2.讲解Jmeter压测减少资源使用的一些建议，即压测结果更准确</h2><p>1、使用非GUI模式：jmeter -n -t test.jmx -l result.jtl</p>
<p>2、少使用Listener， 如果使用-l参数，它们都可以被删除或禁用。</p>
<p>3、在加载测试期间不要使用“查看结果树”或“查看结果”表监听器，只能在脚本阶段使用它们来调试脚本。</p>
<p>4、包含控制器在这里没有帮助，因为它将文件中的所有测试元素添加到测试计划中。]</p>
<p>5、不要使用功能模式,使用CSV输出而不是XML</p>
<p>6、只保存你需要的数据,尽可能少地使用断言</p>
<p>7、如果测试需要大量数据，可以提前准备好测试数据放到数据文件中，以CSV Read方式读取。</p>
<p>8、用内网压测，减少其他带宽影响压测结果</p>
<p>9、如果压测大流量，尽量用多几个节点以非GUI模式向服务器施压</p>
<p>官方推荐 ：<span class="exturl" data-url="aHR0cDovL2pha2FydGEuYXBhY2hlLm9yZy9qbWV0ZXIvdXNlcm1hbnVhbC9iZXN0LXByYWN0aWNlcy5odG1sI2xlYW5fbWVhbg==" title="http://jakarta.apache.org/jmeter/usermanual/best-practices.html#lean_mean">http://jakarta.apache.org/jmeter/usermanual/best-practices.html#lean_mean<i class="fa fa-external-link"></i></span></p>
<h2 id="3-把Jmtere压测结果转换为Html"><a href="#3-把Jmtere压测结果转换为Html" class="headerlink" title="3. 把Jmtere压测结果转换为Html"></a>3. 把Jmtere压测结果转换为Html</h2><p>jmeter -n -t /usr/local/software/jmeter/temp/linux_users_api.jmx -l /usr/local/software/jmeter/temp/jtl/result.jtl -e -o /usr/local/software/jmeter/temp/result讲解压测报告 html里面Dashboard的核心指标</p>
<h3 id="1、dashboard讲解"><a href="#1、dashboard讲解" class="headerlink" title="1、dashboard讲解"></a>1、dashboard讲解</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line">1）Test and Report informations</span><br><span class="line">	Source file：jtl文件名</span><br><span class="line">	Start Time ：压测开始时间</span><br><span class="line">	End Time ：压测结束时间</span><br><span class="line">	Filter for display：过滤器</span><br><span class="line">	Lable:sampler采样器名称	</span><br><span class="line"></span><br><span class="line">2）APDEX(Application performance Index)</span><br><span class="line">	apdex:应用程序性能指标,范围在0~1之间，1表示达到所有用户均满意</span><br><span class="line">	T(Toleration threshold)：可接受阀值</span><br><span class="line">	F(Frustration threshold)：失败阀值</span><br><span class="line"></span><br><span class="line">3）Requests Summary</span><br><span class="line">	OK:成功率</span><br><span class="line">	KO:失败率</span><br><span class="line">4）Statistics 统计数据</span><br><span class="line">	lable:sampler采样器名称</span><br><span class="line"></span><br><span class="line">	samples:请求总数，并发数*循环次数</span><br><span class="line">	KO:失败次数</span><br><span class="line">	Error%:失败率</span><br><span class="line"></span><br><span class="line">	Average:平均响应时间</span><br><span class="line">	Min:最小响应时间</span><br><span class="line">	Max:最大响应时间</span><br><span class="line">	90th pct: 90%的用户响应时间不会超过这个值（关注这个就可以了）</span><br><span class="line">	2ms,3ms,4,5,2,6,8,3,9</span><br><span class="line"></span><br><span class="line">	95th pct: 95%的用户响应时间不会超过这个值</span><br><span class="line">	99th pct: 99%的用户响应时间不会超过这个值 (存在极端值)</span><br><span class="line">	throughtput:Request per Second吞吐量 qps</span><br><span class="line"></span><br><span class="line">	received:每秒从服务器接收的数据量</span><br><span class="line">	send：每秒发送的数据量</span><br></pre></td></tr></table></figure>

<h3 id="2、charts讲解"><a href="#2、charts讲解" class="headerlink" title="2、charts讲解"></a>2、charts讲解</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">1)Over Time（随着时间的变化）</span><br><span class="line">	Response Times Over Time：响应时间变化趋势</span><br><span class="line">	Response Time Percentiles Over Time (successful responses)：最大，最小，平均，用户响应时间分布</span><br><span class="line">	Active Threads Over Time：并发用户数趋势</span><br><span class="line">	Bytes Throughput Over Time：每秒接收和请求字节数变化，蓝色表示发送，黄色表示接受</span><br><span class="line">	Latencies Over Time：平均响应延时趋势</span><br><span class="line">	Connect Time Over Time	：连接耗时趋势</span><br><span class="line"></span><br><span class="line">1)Throughput</span><br><span class="line">	Hits Per Second (excluding embedded resources):每秒点击次数</span><br><span class="line">	Codes Per Second (excluding embedded resources)：每秒状态码数量</span><br><span class="line">	Transactions Per Second：即TPS，每秒事务数</span><br><span class="line">	Response Time Vs Request：响应时间和请求数对比</span><br><span class="line">	Latency Vs Request：延迟时间和请求数对比</span><br><span class="line"></span><br><span class="line">1)Response Times</span><br><span class="line">	Response Time Percentiles：响应时间百分比</span><br><span class="line">	Response Time Overview：响应时间概述</span><br><span class="line">	Time Vs Threads：活跃线程数和响应时间</span><br><span class="line">	Response Time Distribution：响应时间分布图</span><br></pre></td></tr></table></figure>

<h1 id="16、Linux服务器上jmeter进行分布式压测"><a href="#16、Linux服务器上jmeter进行分布式压测" class="headerlink" title="16、Linux服务器上jmeter进行分布式压测"></a>16、Linux服务器上jmeter进行分布式压测</h1><h2 id="1、压测注意事项"><a href="#1、压测注意事项" class="headerlink" title="1、压测注意事项"></a>1、压测注意事项</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">the firewalls on the systems are turned off or correct ports are opened.</span><br><span class="line">系统上的防火墙被关闭或正确的端口被打开。</span><br><span class="line"></span><br><span class="line">all the clients are on the same subnet.</span><br><span class="line">所有的客户端都在同一个子网上。</span><br><span class="line"></span><br><span class="line">the server is in the same subnet, if 192.x.x.x or 10.x.x.x IP addresses are used. If the server doesn&#39;t use 192.xx or 10.xx IP address, there shouldn&#39;t be any problems.</span><br><span class="line">如果使用192.x.x.x或10.x.x.x IP地址，则服务器位于同一子网中。 如果服务器不使用192.xx或10.xx IP地址，则不应该有任何问题。</span><br><span class="line"></span><br><span class="line">Make sure JMeter can access the server.</span><br><span class="line">确保JMeter可以访问服务器。</span><br><span class="line"></span><br><span class="line">Make sure you use the same version of JMeter and Java on all the systems. Mixing versions will not work correctly.</span><br><span class="line">确保在所有系统上使用相同版本的JMeter和Java。 混合版本将无法正常工作。</span><br><span class="line"></span><br><span class="line">You have setup SSL for RMI or disabled it.</span><br><span class="line">您已为RMI设置SSL或将其禁用。</span><br><span class="line"></span><br><span class="line">官网地址 http:&#x2F;&#x2F;jmeter.apache.org&#x2F;usermanual&#x2F;jmeter_distributed_testing_step_by_step.html</span><br><span class="line"></span><br><span class="line">压测注意事项：一定要用内网IP，不用用公网IP,用ping去检查</span><br></pre></td></tr></table></figure>

<h2 id="2、专业名字"><a href="#2、专业名字" class="headerlink" title="2、专业名字"></a>2、专业名字</h2><p>master:司令 slave：</p>
<p>奴隶 target：目标</p>
<h3 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h3><p>地址：<span class="exturl" data-url="aHR0cDovL2ptZXRlci5hcGFjaGUub3JnL2ltYWdlcy9zY3JlZW5zaG90cy9kaXN0cmlidXRlZC1uYW1lcy5zdmc=" title="http://jmeter.apache.org/images/screenshots/distributed-names.svg">http://jmeter.apache.org/images/screenshots/distributed-names.svg<i class="fa fa-external-link"></i></span> </p>
<p>地址：<span class="exturl" data-url="aHR0cDovL2ptZXRlci5hcGFjaGUub3JnL2ltYWdlcy9zY3JlZW5zaG90cy9kaXN0cmlidXRlZC1qbWV0ZXIuc3Zn" title="http://jmeter.apache.org/images/screenshots/distributed-jmeter.svg">http://jmeter.apache.org/images/screenshots/distributed-jmeter.svg<i class="fa fa-external-link"></i></span></p>
<h2 id="3、远程拷贝-内网地址-："><a href="#3、远程拷贝-内网地址-：" class="headerlink" title="3、远程拷贝(内网地址)："></a>3、远程拷贝(内网地址)：</h2><p>scp -r /usr/local/software/jdk-8u141-linux-x64.tar.gz <span class="exturl" data-url="aHR0cDovL21haWx0bzpyb290QDE3Mi4xOC4yMzAuMjMz" title="http://mailto:root@172.18.230.233">root@172.18.230.233<i class="fa fa-external-link"></i></span>:/usr/local/software</p>
<p>scp -r /usr/local/software/jmeter/apache-jmeter-4.0.tgz <span class="exturl" data-url="aHR0cDovL21haWx0bzpyb290QDE3Mi4xOC4yMzAuMjMz" title="http://mailto:root@172.18.230.233">root@172.18.230.233<i class="fa fa-external-link"></i></span>:/usr/local/software/jmeter</p>
<h2 id="4、启动"><a href="#4、启动" class="headerlink" title="4、启动"></a>4、启动</h2><p>./jmeter-server 或者 nohup ./jmeter-server &amp;</p>
<h2 id="5、检查启动是否成功"><a href="#5、检查启动是否成功" class="headerlink" title="5、检查启动是否成功"></a>5、检查启动是否成功</h2><p>ps -ef|grep jmeter-server</p>
<p>ps aux|grep jmeter-server</p>
<h1 id="17、Jmeter分布式压测"><a href="#17、Jmeter分布式压测" class="headerlink" title="17、Jmeter分布式压测"></a>17、Jmeter分布式压测</h1><h2 id="本地非GUI分布式压测-r"><a href="#本地非GUI分布式压测-r" class="headerlink" title="本地非GUI分布式压测 -r"></a>本地非GUI分布式压测 -r</h2><p>jmeter -n -t /Users/jack/Desktop/remote.jmx -r -l /Users/jack/Desktop/jtl/result.jtl -e -o /Users/jack/Desktop/result</p>
<h2 id="压测结果"><a href="#压测结果" class="headerlink" title="压测结果"></a>压测结果</h2><p>./jmeter -n -t /Users/jack/Desktop/remote.jmx -r -l /Users/jack/Desktop/jtl/result.jtl -e -o /Users/jack/Desktop/result</p>
<h2 id="压测报告"><a href="#压测报告" class="headerlink" title="压测报告"></a>压测报告</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">Creating summariser &lt;summary&gt;</span><br><span class="line">Created the tree successfully using &#x2F;Users&#x2F;jack&#x2F;Desktop&#x2F;remote.jmx</span><br><span class="line">Configuring remote engine: 172.20.10.3:8899</span><br><span class="line">Using local port: 8899</span><br><span class="line">Configuring remote engine: 172.20.10.11:8899</span><br><span class="line">Starting remote engines</span><br><span class="line">Starting the test @ Thu Mar 29 23:21:13 CST 2018 (1522336873931)</span><br><span class="line">Remote engines have been started</span><br><span class="line">Waiting for possible Shutdown&#x2F;StopTestNow&#x2F;Heapdump message on port 4445</span><br><span class="line">summary &#x3D;      4 in 00:00:22 &#x3D;    0.2&#x2F;s Avg:  5582 Min:    94 Max: 21006 Err:     1 (25.00%)</span><br><span class="line">Tidying up remote @ Thu Mar 29 23:21:36 CST 2018 (1522336896842)</span><br><span class="line">... end of run</span><br></pre></td></tr></table></figure>

<h2 id="压测修改master节点信息"><a href="#压测修改master节点信息" class="headerlink" title="压测修改master节点信息"></a>压测修改master节点信息</h2><p>jemeter.properties 值是slave机器的ip+端口号，如果有多个，用逗号分隔 remote_hosts=192.168.0.102:8899,192.168.0.101:8899 server.rmi.ssl.disable=true (前面有说到)</p>
<h2 id="启动slave机器，注意要同个网段，ip地址用内网ip"><a href="#启动slave机器，注意要同个网段，ip地址用内网ip" class="headerlink" title="启动slave机器，注意要同个网段，ip地址用内网ip"></a>启动slave机器，注意要同个网段，ip地址用内网ip</h2><p>./jmeter-server Using local port: 8899 Created remote object: UnicastServerRef2 [liveRef: [endpoint:<span class="exturl" data-url="aHR0cDovL2xvY2Fs" title="http://local">192.168.0.102:8899<i class="fa fa-external-link"></i></span>,objID:[3a585a4d:162724586ab:-7fff, 3963132813614033916]]]</p>
<h2 id="相关资料："><a href="#相关资料：" class="headerlink" title="相关资料："></a>相关资料：</h2><p><span class="exturl" data-url="aHR0cHM6Ly93d3cuY25ibG9ncy5jb20vRmluZS1DaGFuL3AvNjIzMzgyMy5odG1s" title="https://www.cnblogs.com/Fine-Chan/p/6233823.html">https://www.cnblogs.com/Fine-Chan/p/6233823.html<i class="fa fa-external-link"></i></span> <span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xpdWppbmdxaXUvYXJ0aWNsZS9kZXRhaWxzLzUyNjM1Mjg5aHR0cHM6Ly93d3cuY25ibG9ncy5jb20vcHVyZXNvdWwvcC80ODQ0NTM5Lmh0bWw=" title="https://blog.csdn.net/liujingqiu/article/details/52635289https://www.cnblogs.com/puresoul/p/4844539.html">https://blog.csdn.net/liujingqiu/article/details/52635289https://www.cnblogs.com/puresoul/p/4844539.html<i class="fa fa-external-link"></i></span></p>
<h1 id="18-、测试基本内容"><a href="#18-、测试基本内容" class="headerlink" title="18.、测试基本内容"></a>18.、测试基本内容</h1><p><strong>配置元件=》前置处理器=》定时器=》采样器=》后置处理器=》断言=》监听器</strong></p>
<h1 id="19、安装常见问题"><a href="#19、安装常见问题" class="headerlink" title="19、安装常见问题"></a>19、安装常见问题</h1><h2 id="1、问题：无法解析"><a href="#1、问题：无法解析" class="headerlink" title="1、问题：无法解析"></a>1、问题：无法解析</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">[root@iZwz95j86y235aroi85ht0Z bin]# .&#x2F;jmeter-server</span><br><span class="line">	Created remote object: UnicastServerRef2 [liveRef: [endpoint:[:39308](local),objID:[24e78a63:16243c70661:-7fff, 7492480871343944173]]]</span><br><span class="line">	Server failed to start: java.rmi.RemoteException: Cannot start. Unable to get local host IP address.; nested exception is:</span><br><span class="line">	java.net.UnknownHostException: iZwz95j86y235aroi85ht0Z: iZwz95j86y235aroi85ht0Z: Name or service not known</span><br><span class="line">	An error occurred: Cannot start. Unable to get local host IP address.; nested exception is:</span><br><span class="line">	java.net.UnknownHostException: iZwz95j86y235aroi85ht0Z: iZwz95j86y235aroi85ht0Z: Name or service not known</span><br></pre></td></tr></table></figure>

<h3 id="解决："><a href="#解决：" class="headerlink" title="解决："></a>解决：</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">hostname  命令获取机器名称，追加一个映射  iZwz95j86y235aroi85ht0Z</span><br><span class="line">		vim &#x2F;etc&#x2F;hosts</span><br><span class="line">			127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4</span><br><span class="line">			::1         localhost localhost.localdomain localhost6 localhost6.localdomain6</span><br><span class="line">			120.79.160.143 iZwz95j86y235aroi85ht0Z</span><br><span class="line"></span><br><span class="line">windows用户 修改c:\windows\system32\drivers\etc\hosts文件，增加一条域名 与IP的映射</span><br></pre></td></tr></table></figure>

<h2 id="2-问题：禁用了SSL"><a href="#2-问题：禁用了SSL" class="headerlink" title="2.问题：禁用了SSL"></a>2.问题：禁用了SSL</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">[root@iZwz95j86y235aroi85ht0Z bin]# .&#x2F;jmeter-server</span><br><span class="line">	Server failed to start: java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:</span><br><span class="line">	java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory)</span><br><span class="line">	An error occurred: Listen failed on port: 0; nested exception is:</span><br><span class="line">	java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory)</span><br></pre></td></tr></table></figure>

<h3 id="解决：-1"><a href="#解决：-1" class="headerlink" title="解决："></a>解决：</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">拥有RMI over SSL的有效密钥库，或者禁用了SSL。</span><br><span class="line">1、禁用SSL</span><br><span class="line">  jmeter.property里面 server.rmi.ssl.disable 改为 true，表示禁用</span><br></pre></td></tr></table></figure>

<h2 id="3、问题："><a href="#3、问题：" class="headerlink" title="3、问题："></a>3、问题：</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">[root@iZ949uw2xehZ bin]# .&#x2F;jmeter</span><br><span class="line">		Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error&#x3D;&#39;Cannot allocate memory&#39; (errno&#x3D;12)</span><br><span class="line">		#</span><br><span class="line">		# There is insufficient memory for the Java Runtime Environment to continue.</span><br><span class="line">		# Native memory allocation (mmap) failed to map 1073741824 bytes for committing reserved memory.</span><br><span class="line">		# An error report file with more information is saved as:</span><br><span class="line">		# &#x2F;usr&#x2F;local&#x2F;jmeter&#x2F;apache-jmeter-4.0&#x2F;bin&#x2F;hs_err_pid5855.log</span><br></pre></td></tr></table></figure>

<h3 id="解决：-2"><a href="#解决：-2" class="headerlink" title="解决："></a>解决：</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">编辑jmeter</span><br><span class="line">搜索 : &quot;$&#123;HEAP:&#x3D;&quot;-Xms1g -Xmx1g -XX:MaxMetaspaceSize&#x3D;256m&quot;&#125;&quot;</span><br><span class="line">改变初始堆内存和最大堆内存</span><br></pre></td></tr></table></figure>

<h2 id="4、仅修改-server-port-即可-下面两者一样"><a href="#4、仅修改-server-port-即可-下面两者一样" class="headerlink" title="4、仅修改 server_port 即可,下面两者一样"></a>4、仅修改 server_port 即可,下面两者一样</h2><p>server.rmi.localport=8899 表示slave server启动显示的端口</p>
<p>server_port=8899 表示master机器要远程连接的端口 即 remote_hosts=xxxx:8899</p>
<h2 id="5、—–"><a href="#5、—–" class="headerlink" title="5、—–"></a>5、—–</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">&lt;!-- jmeter 分布式性能测试（多网卡配置） --&gt;</span><br><span class="line">我们要在多网卡的服务器上开启RMI服务的话必须指定IP，使他们能够在同一个网段内。 </span><br><span class="line"></span><br><span class="line">需要以下几步（假定所有机器都在10.120.11.*网段,agent服务器为linux,controller服务器为windows）：</span><br><span class="line"></span><br><span class="line">1、 修改agent服务器，指定agent机器的IP</span><br><span class="line">修改jmeter-server文件</span><br><span class="line"># vi jmeter-server</span><br><span class="line">修改RMI_HOST_DEF&#x3D;-Djava.rmi.server.hostname&#x3D;xxx.xxx.xxx.xxx(需要连接的IP)</span><br><span class="line"></span><br><span class="line">2、修改server服务器，指定server机器的IP</span><br><span class="line"></span><br><span class="line">修改jmeter.bat文件 </span><br><span class="line"></span><br><span class="line">新增set rmi_host&#x3D;-Djava.rmi.server.hostname&#x3D;10.120.11.214</span><br><span class="line"></span><br><span class="line">修改set ARGS&#x3D;%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %PERM% %DDRAW% %rmi_host%</span><br></pre></td></tr></table></figure>

<h2 id="6、确定在controller机器上安装jdk-版本和jmeter一致，配置环境变量：Java-home等"><a href="#6、确定在controller机器上安装jdk-版本和jmeter一致，配置环境变量：Java-home等" class="headerlink" title="6、确定在controller机器上安装jdk,版本和jmeter一致，配置环境变量：Java_home等"></a>6、确定在controller机器上安装jdk,版本和jmeter一致，配置环境变量：Java_home等</h2><ul>
<li>在Agent机器上安装jdk，配置环境变量：Java_home和JMeter_home</li>
<li>安装目录不要带空格，最好都是简短的英文路径</li>
</ul>
<h2 id="7、master机器启动后会拷贝jmx文件到slave机器，所以不需要在每台slave机器上也上传一份jmx，只需要在master机器上上传一份jmx脚本即可。"><a href="#7、master机器启动后会拷贝jmx文件到slave机器，所以不需要在每台slave机器上也上传一份jmx，只需要在master机器上上传一份jmx脚本即可。" class="headerlink" title="7、master机器启动后会拷贝jmx文件到slave机器，所以不需要在每台slave机器上也上传一份jmx，只需要在master机器上上传一份jmx脚本即可。"></a>7、master机器启动后会拷贝jmx文件到slave机器，所以不需要在每台slave机器上也上传一份jmx，只需要在master机器上上传一份jmx脚本即可。</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">如果使用csv进行参数化，则需要把参数文件在每台slave上拷一份且路径需要设置成一样的。</span><br><span class="line"></span><br><span class="line">总样本数 &#x3D; 线程数 * 循环次数 * 执行机总数</span><br></pre></td></tr></table></figure>

<h2 id="8、连接失败原因排查"><a href="#8、连接失败原因排查" class="headerlink" title="8、连接失败原因排查"></a>8、连接失败原因排查</h2><h4 id="以下步骤进行排查："><a href="#以下步骤进行排查：" class="headerlink" title="以下步骤进行排查："></a>以下步骤进行排查：</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">1. jmeter-server是否启动；</span><br><span class="line">	2. 是否联网</span><br><span class="line">	3. ping 服务器IP是否畅通.</span><br><span class="line">	4. telnet 端口 192.168.3.10 1099</span><br><span class="line">	5. 检查服务器的防火墙是否关闭。</span><br><span class="line">	6. 阿里云安全策略是否正常</span><br></pre></td></tr></table></figure>

<h2 id="9、”could-not-find-ApacheJmeter-core-jar”"><a href="#9、”could-not-find-ApacheJmeter-core-jar”" class="headerlink" title="9、”could not find ApacheJmeter_core.jar”"></a>9、”could not find ApacheJmeter_core.jar”</h2><p>​    <strong>解决：在Agent机器安装jdk，并设置环境变量</strong></p>
<h2 id="10、”Bad-call-to-remote-host”"><a href="#10、”Bad-call-to-remote-host”" class="headerlink" title="10、”Bad call to remote host”"></a>10、”Bad call to remote host”</h2><p>解决：检查被控制机器上的jmeter-server有没有启动，或者remote_hosts的配置是否正确。</p>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/kity@2.0.4/dist/kity.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/kityminder-core@1.4.50/dist/kityminder.core.min.js"></script><script defer="true" type="text/javascript" src="https://cdn.jsdelivr.net/npm/hexo-simple-mindmap@0.2.0/dist/mindmap.min.js"></script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/hexo-simple-mindmap@0.2.0/dist/mindmap.min.css">
    </div>

    
    
    
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>lazytime
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://whitestore.top/2023/09/09/note20/" title="Jmeter压力测试学习">https://whitestore.top/2023/09/09/note20/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <span class="exturl" data-url="aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLzQuMC96aC1DTg=="><i class="fa fa-fw fa-creative-commons"></i>BY-NC</span> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Java/" rel="tag"># Java</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2023/09/07/masteringjava/" rel="prev" title="【Java】Mastering Backend Development with Java">
      <i class="fa fa-chevron-left"></i> 【Java】Mastering Backend Development with Java
    </a></div>
      <div class="post-nav-item">
    <a href="/2023/09/09/photo1/" rel="next" title="【摄影】通向另一个世界的窗口——摄影构图三步法">
      【摄影】通向另一个世界的窗口——摄影构图三步法 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#前言："><span class="nav-number">1.</span> <span class="nav-text">前言：</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#1-目前用的常用测试工具对比"><span class="nav-number"></span> <span class="nav-text">1. 目前用的常用测试工具对比</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、loadrunner"><span class="nav-number">1.</span> <span class="nav-text">1、loadrunner</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、apache-ab-单接口压测最方便"><span class="nav-number">2.</span> <span class="nav-text">2、apache ab(单接口压测最方便)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3、webbench"><span class="nav-number">3.</span> <span class="nav-text">3、webbench</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#2-Jmeter基本介绍和使用场景"><span class="nav-number"></span> <span class="nav-text">2. Jmeter基本介绍和使用场景</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、压测不同的协议和应用"><span class="nav-number">1.</span> <span class="nav-text">1、压测不同的协议和应用</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、使用场景及优点"><span class="nav-number">2.</span> <span class="nav-text">2、使用场景及优点</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#3-本地快速安装Jmeter4-x"><span class="nav-number"></span> <span class="nav-text">3. 本地快速安装Jmeter4.x</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、需要安装JDK8。或者JDK9-JDK10-建议不要使用jre10"><span class="nav-number">1.</span> <span class="nav-text">1、需要安装JDK8。或者JDK9,JDK10 (建议不要使用jre10)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、快速下载"><span class="nav-number">2.</span> <span class="nav-text">2、快速下载</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3、文档地址：http-jmeter-apache-org-usermanual-get-started-html"><span class="nav-number">3.</span> <span class="nav-text">3、文档地址：http:&#x2F;&#x2F;jmeter.apache.org&#x2F;usermanual&#x2F;get-started.html</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4、建议安装JDK环境，虽然JRE也可以，但是压测https需要JDK里面的-keytool工具"><span class="nav-number">4.</span> <span class="nav-text">4、建议安装JDK环境，虽然JRE也可以，但是压测https需要JDK里面的 keytool工具</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#4-jemeter-目录结构"><span class="nav-number"></span> <span class="nav-text">4. jemeter 目录结构</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#bin-核心可执行文件，包含配置"><span class="nav-number">1.</span> <span class="nav-text">bin:核心可执行文件，包含配置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#extras：插件拓展的包"><span class="nav-number">2.</span> <span class="nav-text">extras：插件拓展的包</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#5-改变jmeter的GUI界面语言版本"><span class="nav-number"></span> <span class="nav-text">5. 改变jmeter的GUI界面语言版本</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、控制台修改"><span class="nav-number">1.</span> <span class="nav-text">1、控制台修改</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、配置文件修改"><span class="nav-number">2.</span> <span class="nav-text">2、配置文件修改</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#6-jemeter-菜单介绍"><span class="nav-number"></span> <span class="nav-text">6. jemeter 菜单介绍</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、添加-gt-threads-gt-线程组（控制总体并发）"><span class="nav-number">1.</span> <span class="nav-text">1、添加-&gt;threads-&gt;线程组（控制总体并发）</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、线程组-gt-添加-gt-Sampler-采样器-gt-Http-（一个线程组下面可以增加几个Sampler）"><span class="nav-number">2.</span> <span class="nav-text">2、线程组-&gt;添加-&gt; Sampler(采样器) -&gt; Http （一个线程组下面可以增加几个Sampler）</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3、查看测试结果"><span class="nav-number">3.</span> <span class="nav-text">3、查看测试结果</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#线程组-gt-添加-gt-监听器-gt-察看结果树"><span class="nav-number">3.1.</span> <span class="nav-text">线程组-&gt;添加-&gt;监听器-&gt;察看结果树</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#7-断言的基本使用"><span class="nav-number"></span> <span class="nav-text">7. 断言的基本使用</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-增加断言-线程组-gt-添加-gt-断言-gt-响应断言"><span class="nav-number">1.</span> <span class="nav-text">1. 增加断言: 线程组 -&gt; 添加 -&gt; 断言 -&gt; 响应断言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-要测试的响应字段："><span class="nav-number">2.</span> <span class="nav-text">2.要测试的响应字段：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-模式匹配规则："><span class="nav-number">3.</span> <span class="nav-text">3.模式匹配规则：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-断言结果监听器-线程组-gt-添加-gt-监听器-gt-断言结果"><span class="nav-number">4.</span> <span class="nav-text">4.断言结果监听器: 线程组-&gt; 添加 -&gt; 监听器 -&gt; 断言结果</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-每个sample下面可以加单独的结果树，然后同时加多个断言，最外层可以加个结果树进行汇总"><span class="nav-number">5.</span> <span class="nav-text">5.每个sample下面可以加单独的结果树，然后同时加多个断言，最外层可以加个结果树进行汇总</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#8-Jmeter压测结果聚合报告分析"><span class="nav-number"></span> <span class="nav-text">8. Jmeter压测结果聚合报告分析</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-新增聚合报告：线程组-gt-添加-gt-监听器-gt-聚合报告（Aggregate-Report）"><span class="nav-number">1.</span> <span class="nav-text">1.新增聚合报告：线程组-&gt;添加-&gt;监听器-&gt;聚合报告（Aggregate Report）</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-为什么使用：很多变量在全局中都有使用，或者测试数据更改，可以在一处定义，四处使用-比如服务器地址"><span class="nav-number">2.</span> <span class="nav-text">2.为什么使用：很多变量在全局中都有使用，或者测试数据更改，可以在一处定义，四处使用(比如服务器地址)</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1、线程组-gt-add-gt-Config-Element-配置原件-gt-User-Definde-Variable（用户定义的变量）"><span class="nav-number">2.1.</span> <span class="nav-text">1、线程组-&gt;add -&gt; Config Element(配置原件)-&gt; User Definde Variable（用户定义的变量）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2、引用方式-XXX-，在接口中变量中使用"><span class="nav-number">2.2.</span> <span class="nav-text">2、引用方式${XXX}，在接口中变量中使用</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3、原始查看结果树和非原生查看（基础按钮）"><span class="nav-number">2.3.</span> <span class="nav-text">3、原始查看结果树和非原生查看（基础按钮）</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#9-CSV可变参数压测（重要）"><span class="nav-number"></span> <span class="nav-text">9. CSV可变参数压测（重要）</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、线程组-gt-add-gt-Config-Element-配置原件-gt-CSV-data-set-config-CSV数据文件设置"><span class="nav-number">1.</span> <span class="nav-text">1、线程组-&gt;add -&gt; Config Element(配置原件)-&gt; CSV data set config (CSV数据文件设置)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、在读取的配置文件里面，同时使用多个自定义参数"><span class="nav-number">2.</span> <span class="nav-text">2、在读取的配置文件里面，同时使用多个自定义参数</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#10、JDBC-request压测Mysql"><span class="nav-number"></span> <span class="nav-text">10、JDBC request压测Mysql</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、Thread-Group-gt-add-gt-sampler-gt-jdbc-request"><span class="nav-number">1.</span> <span class="nav-text">1、Thread Group -&gt; add -&gt; sampler -&gt; jdbc request</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、jar包添加-mysql-connector-java-5-1-30-jar"><span class="nav-number">2.</span> <span class="nav-text">2、jar包添加 mysql-connector-java-5.1.30.jar</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3、JDBC-connection-Configuration-配置"><span class="nav-number">3.</span> <span class="nav-text">3、JDBC connection Configuration 配置</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#11-request压测Mysql-select语句"><span class="nav-number"></span> <span class="nav-text">11. request压测Mysql, select语句</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-Debug-Sampler使用（结果树中查看）"><span class="nav-number">1.</span> <span class="nav-text">1. Debug Sampler使用（结果树中查看）</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-参数讲解：-sql结尾不要加”-”"><span class="nav-number">2.</span> <span class="nav-text">2. 参数讲解：(sql结尾不要加”;”)</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#12-分布式压测（学习重点）"><span class="nav-number"></span> <span class="nav-text">12. 分布式压测（学习重点）</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#13-Jmeter分布式压测原理-了解"><span class="nav-number"></span> <span class="nav-text">13. Jmeter分布式压测原理(了解)</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#14-阿里云安装jmeter-守护进程：nohup-java-jar-xxxxx-amp"><span class="nav-number"></span> <span class="nav-text">14. 阿里云安装jmeter (守护进程：nohup java -jar xxxxx &amp;)</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-下载方式：wget-http-apache-osuosl-org-jmeter-binaries-apache-jmeter-4-0-tgz"><span class="nav-number">1.</span> <span class="nav-text">1. 下载方式：wget http:&#x2F;&#x2F;apache.osuosl.org&#x2F;&#x2F;jmeter&#x2F;binaries&#x2F;apache-jmeter-4.0.tgz</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-直接到官网下载对应tag-gz包，并在服务器解压"><span class="nav-number">2.</span> <span class="nav-text">2. 直接到官网下载对应tag.gz包，并在服务器解压</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#15-Jmeter非GUI界面-参数讲解-必须掌握"><span class="nav-number"></span> <span class="nav-text">15. Jmeter非GUI界面 参数讲解(必须掌握)</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-阿里云非GUI-jmeter-压测"><span class="nav-number">1.</span> <span class="nav-text">1.阿里云非GUI jmeter 压测</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-讲解Jmeter压测减少资源使用的一些建议，即压测结果更准确"><span class="nav-number">2.</span> <span class="nav-text">2.讲解Jmeter压测减少资源使用的一些建议，即压测结果更准确</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-把Jmtere压测结果转换为Html"><span class="nav-number">3.</span> <span class="nav-text">3. 把Jmtere压测结果转换为Html</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1、dashboard讲解"><span class="nav-number">3.1.</span> <span class="nav-text">1、dashboard讲解</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2、charts讲解"><span class="nav-number">3.2.</span> <span class="nav-text">2、charts讲解</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#16、Linux服务器上jmeter进行分布式压测"><span class="nav-number"></span> <span class="nav-text">16、Linux服务器上jmeter进行分布式压测</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、压测注意事项"><span class="nav-number">1.</span> <span class="nav-text">1、压测注意事项</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、专业名字"><span class="nav-number">2.</span> <span class="nav-text">2、专业名字</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#参考"><span class="nav-number">2.1.</span> <span class="nav-text">参考</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3、远程拷贝-内网地址-："><span class="nav-number">3.</span> <span class="nav-text">3、远程拷贝(内网地址)：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4、启动"><span class="nav-number">4.</span> <span class="nav-text">4、启动</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5、检查启动是否成功"><span class="nav-number">5.</span> <span class="nav-text">5、检查启动是否成功</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#17、Jmeter分布式压测"><span class="nav-number"></span> <span class="nav-text">17、Jmeter分布式压测</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#本地非GUI分布式压测-r"><span class="nav-number">1.</span> <span class="nav-text">本地非GUI分布式压测 -r</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#压测结果"><span class="nav-number">2.</span> <span class="nav-text">压测结果</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#压测报告"><span class="nav-number">3.</span> <span class="nav-text">压测报告</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#压测修改master节点信息"><span class="nav-number">4.</span> <span class="nav-text">压测修改master节点信息</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#启动slave机器，注意要同个网段，ip地址用内网ip"><span class="nav-number">5.</span> <span class="nav-text">启动slave机器，注意要同个网段，ip地址用内网ip</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#相关资料："><span class="nav-number">6.</span> <span class="nav-text">相关资料：</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#18-、测试基本内容"><span class="nav-number"></span> <span class="nav-text">18.、测试基本内容</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#19、安装常见问题"><span class="nav-number"></span> <span class="nav-text">19、安装常见问题</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、问题：无法解析"><span class="nav-number">1.</span> <span class="nav-text">1、问题：无法解析</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#解决："><span class="nav-number">1.1.</span> <span class="nav-text">解决：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-问题：禁用了SSL"><span class="nav-number">2.</span> <span class="nav-text">2.问题：禁用了SSL</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#解决：-1"><span class="nav-number">2.1.</span> <span class="nav-text">解决：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3、问题："><span class="nav-number">3.</span> <span class="nav-text">3、问题：</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#解决：-2"><span class="nav-number">3.1.</span> <span class="nav-text">解决：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4、仅修改-server-port-即可-下面两者一样"><span class="nav-number">4.</span> <span class="nav-text">4、仅修改 server_port 即可,下面两者一样</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5、—–"><span class="nav-number">5.</span> <span class="nav-text">5、—–</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6、确定在controller机器上安装jdk-版本和jmeter一致，配置环境变量：Java-home等"><span class="nav-number">6.</span> <span class="nav-text">6、确定在controller机器上安装jdk,版本和jmeter一致，配置环境变量：Java_home等</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7、master机器启动后会拷贝jmx文件到slave机器，所以不需要在每台slave机器上也上传一份jmx，只需要在master机器上上传一份jmx脚本即可。"><span class="nav-number">7.</span> <span class="nav-text">7、master机器启动后会拷贝jmx文件到slave机器，所以不需要在每台slave机器上也上传一份jmx，只需要在master机器上上传一份jmx脚本即可。</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8、连接失败原因排查"><span class="nav-number">8.</span> <span class="nav-text">8、连接失败原因排查</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#以下步骤进行排查："><span class="nav-number">8.0.1.</span> <span class="nav-text">以下步骤进行排查：</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#9、”could-not-find-ApacheJmeter-core-jar”"><span class="nav-number">9.</span> <span class="nav-text">9、”could not find ApacheJmeter_core.jar”</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#10、”Bad-call-to-remote-host”"><span class="nav-number">10.</span> <span class="nav-text">10、”Bad call to remote host”</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">阿东</p>
  <div class="site-description" itemprop="description">随遇而安</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">239</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">36</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">37</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2xhenlUaW1lcw==" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;lazyTimes"><i class="fa fa-fw fa-github"></i>GitHub</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="bWFpbHRvOjEwOTc0ODM1MDhAcXEuY29t" title="E-Mail → mailto:1097483508@qq.com"><i class="fa fa-fw fa-envelope"></i>E-Mail</span>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly93d3cuNTJwb2ppZS5jbi9ob21lLnBocD9tb2Q9c3BhY2UmdWlkPTE0OTc3MTgmZG89dGhyZWFkJnZpZXc9bWUmZnJvbT1zcGFjZQ==" title="https:&#x2F;&#x2F;www.52pojie.cn&#x2F;home.php?mod&#x3D;space&amp;uid&#x3D;1497718&amp;do&#x3D;thread&amp;view&#x3D;me&amp;from&#x3D;space">吾爱破解</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9qdWVqaW4uaW0vdXNlci8yOTk5MTIzNDUyNjI2MzY2" title="https:&#x2F;&#x2F;juejin.im&#x2F;user&#x2F;2999123452626366">掘金</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9zZWdtZW50ZmF1bHQuY29tL3UvbGF6eXRpbWVz" title="https:&#x2F;&#x2F;segmentfault.com&#x2F;u&#x2F;lazytimes">思否</span>
        </li>
    </ul>
  </div>

      </div>

      <div class="wechat_OA">
        <span>欢迎关注我的公众号</span>
        <br>
          <!-- 这里添加你的二维码图片 -->
        <img src ="https://adong-picture.oss-cn-shenzhen.aliyuncs.com/adong/wechat_channel.jpg">
      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">阿东</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
      <span class="post-meta-item-text">站点总字数：</span>
    <span title="站点总字数">2m</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">29:50</span>
</div>
  <div class="powered-by">由 <span class="exturl theme-link" data-url="aHR0cHM6Ly9oZXhvLmlv">Hexo</span> & <span class="exturl theme-link" data-url="aHR0cHM6Ly90aGVtZS1uZXh0Lm9yZw==">NexT.Gemini</span> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : true,
      appId      : 'qMUpEEvBgXaMDD1b0ftgi9xr-gzGzoHsz',
      appKey     : 'UCdfT4Rfih6MO6y8DI4fstf6',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
